package com.retail.member.controller;

import com.retail.core.entity.result.Result;
import com.retail.member.client.ShopCardClient;
import com.retail.shop.entity.request.ShopCardRequest;
import com.retail.shop.entity.vo.ShopCardVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(value = "商户权益卡", tags = "商户权益卡API")
@RestController
@RequestMapping("api/shopCard")
public class ShopCardApiController {

    private final ShopCardClient shopCardClient;

    public ShopCardApiController(ShopCardClient shopCardClient) {
        this.shopCardClient = shopCardClient;
    }

    @GetMapping("shopAllCards")
    public Result<List<ShopCardVo>> shopAllCards() {
        return shopCardClient.shopAllCards();
    }

    @PostMapping("applyShopCard")
    public Result<Integer> applyShopCard(@RequestBody ShopCardRequest request) {
        return shopCardClient.applyShopCard(request);
    }

}
